package com.aterrizar.ui;

import org.uqbar.arena.actions.MessageSend;
import org.uqbar.arena.widgets.Button;
import org.uqbar.arena.widgets.Label;
import org.uqbar.arena.widgets.Panel;
import org.uqbar.arena.windows.Dialog;
import org.uqbar.arena.windows.WindowOwner;
import org.uqbar.ui.jface.builder.ErrorsPanel;

import com.aterrizar.asiento.Asiento;

public class OperationFailureDialog extends Dialog<Asiento> {

	private static final long serialVersionUID = 5702545936853670178L;

	private String participio;
	
	public OperationFailureDialog(WindowOwner parent, Asiento asiento, String participio) {
		super(parent, asiento);
		this.participio = participio;
	}

	@Override
	protected void createFormPanel(Panel panel) {
		new Label(panel).setText("El asiento " + this.getModelObject().getCodigo() + " ha sido " + participio + " exitosamente");
	}
	
	@Override
	protected void addActions(Panel actionsPanel) {
		new Button(actionsPanel).setAsDefault().setCaption("Seguir Buscando").onClick(new MessageSend(this, "close"));
	}
	
	@Override
	protected ErrorsPanel createErrorsPanel(Panel mainPanel) {
		return null;
	}
	
	
}
